# $Id$
# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=freeciv
pkgver=2.5.9
pkgrel=1
pkgdesc="A multiuser clone of the famous Microprose game of Civilization"
arch=('i686' 'x86_64')
url="http://www.freeciv.org/"
license=('GPL')
depends=('gtk3' 'sdl_mixer' 'lua52' 'sqlite' 'curl' 'libtool')
makedepends=('python')
backup=('etc/freeciv/database.lua')
source=(http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.bz2
        lua52_compat.patch)
sha1sums=('4fe9d83fcfdbd5afbf17816974aa0395c729fc96'
          '248f4c8b62557677bf27a0d06feb15148d811ce7')

prepare() {
  cd ${pkgname}-${pkgver}
  patch -p1 -i "$srcdir"/lua52_compat.patch
  autoreconf -vi
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr --sysconfdir=/etc --enable-shared --enable-sys-lua \
    --enable-client=gtk3 --enable-fcmp=gtk3 --enable-fcdb=sqlite3 --enable-aimodules
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
}
